function f = my_decorateFig(f,fa,opt)
	% f = my_decorateFig(opt)
	% -------- custom function ------
	% description:
	% 	decorate figure
	% input:
	% 	"Aspect":  paper width:height
	%				1 = 4:3, 2 = 16:9
	%	"FontSize": double or logical
	%		double is fontsize to set
	%		false means don't change font size
	% output:
	%	
	% Author: Sid Chen
	% Date: 
	% issue:
	% 	1. don't support tiledlayout
	arguments
		f = NaN 
		fa = NaN
		opt.Aspect = 1
		opt.FontSize = 16
	end
	
	if class(f) == "double" && isnan(f)
		f = gcf;
	end

	if class(fa) == "double" && isnan(fa)
		fa = gca;
	end


	Position = getPosition(opt.Aspect);
	% set size
	set(f,'Units','centimeters');
	set(f,'Position',Position);
	set(f,'PaperUnits','centimeters');
	set(f,'PaperPosition',Position);
	set(f,'PaperUnits','centimeters');
	set(f,'PaperPosition',Position);
	% set fontsize
	if opt.FontSize
		set(fa,'FontSize',opt.FontSize);
	end
	set(fa,'TitleFontSizeMultiplier',1.33);
	figure(f);
end

function out = getPosition(Type)
	switch Type
		case 1
			out = [5,5,22.5,16.875];
		case 2
			out = [5,5,30,16.875];
		otherwise
			error("wrong type")
	end
end
